package cn.yunyichina.provider.hisiface.service.impl;

import java.util.List;

import cn.yunyichina.provider.iface.entity.hisiface.BaseVo;
import cn.yunyichina.provider.iface.entity.hisiface.register.*;
import org.springframework.stereotype.Service;

import cn.yunyichina.provider.hisiface.service.AbstractService;
import cn.yunyichina.provider.iface.entity.common.ResCommon;

/**
 * 挂号服务接口
 *
 * @author zhou
 */
@Service
public class HisifaceRegisterServiceImpl extends AbstractService {

    /**
     * 可挂号科室查询
     *
     * @param registerDeptsVo
     * @return
     */
    public ResCommon<List<RegisterDeptsVoResponse>> getRegisterDepts(RegisterDeptsVo registerDeptsVo) {
        String methodCode = "getRegisterDepts";
        String methodName = "可挂号科室查询";

        return doExecList(methodCode, methodName, registerDeptsVo, RegisterDeptsVoResponse.class);
    }

    /**
     * 医生资料查询
     *
     * @param registerDoctorsVo
     * @return
     */
    public ResCommon<List<RegisterDoctorsVoResponse>> getRegisterDoctors(RegisterDoctorsVo registerDoctorsVo) {
        String methodCode = "getRegisterDoctors";
        String methodName = "医生资料查询";

        return doExecList(methodCode, methodName, registerDoctorsVo, RegisterDoctorsVoResponse.class);
    }

    /**
     * 号源信息查询
     *
     * @param registerInfoVo
     * @return
     */
    public ResCommon<List<RegisterInfoVoResponse>> getRegisterInfo(RegisterInfoVo registerInfoVo) {
        String methodCode = "getRegisterInfo";
        String methodName = "号源信息查询";

        return doExecList(methodCode, methodName, registerInfoVo, RegisterInfoVoResponse.class);
    }

    /**
     * 医生分时查询
     *
     * @param registerDoctorTimeVo
     * @return
     */
    public ResCommon<List<RegisterDoctorTimeVoResponse>> getRegisterDoctorTime(RegisterDoctorTimeVo registerDoctorTimeVo) {
        String methodCode = "getRegisterDoctorTime";
        String methodName = "医生分时查询";

        return doExecList(methodCode, methodName, registerDoctorTimeVo, RegisterDoctorTimeVoResponse.class);
    }

    /**
     * 挂号（锁号）
     *
     * @param orderRegisterVo
     * @return
     */
    public ResCommon<OrderRegisterVoResponse> orderRegister(OrderRegisterVo orderRegisterVo) {
        String methodCode = "orderRegister";
        String methodName = "挂号";

        return doExec(methodCode, methodName, orderRegisterVo, OrderRegisterVoResponse.class);
    }

    /**
     * 取消挂号（锁号）
     *
     * @param cancelRegisterVo
     * @return
     */
    public ResCommon<Void> cancelRegister(CancelRegisterVo cancelRegisterVo) {
        String methodCode = "cancelRegister";
        String methodName = "取消挂号";

        return doExec(methodCode, methodName, cancelRegisterVo, null);
    }

    /**
     * 挂号支付写单
     *
     * @param payRegisterVo
     * @return
     */
    public ResCommon<PayRegisterVoResponse> payRegister(PayRegisterVo payRegisterVo) {
        String methodCode = "payRegister";
        String methodName = "挂号支付写单";

        return doExec(methodCode, methodName, payRegisterVo, PayRegisterVoResponse.class);
    }

    /**
     * 挂号退费确认
     * <p>
     * 只判断输入的订单及金额是否符合退费条件，不修改任何挂号记录及订单信息
     *
     * @param ackRegisterRefundVo
     * @return
     */
    public ResCommon<AckRegisterRefundVoResponse> ackRegisterRefund(AckRegisterRefundVo ackRegisterRefundVo) {
        String methodCode = "ackRegisterRefund";
        String methodName = "挂号退费确认";

        return doExec(methodCode, methodName, ackRegisterRefundVo, AckRegisterRefundVoResponse.class);
    }

    /**
     * 挂号退费
     * <p>
     * 医院对挂号退费有自己的限定，由接口按医院实际情况做限定，并将限定信息通过“错误消息”返回
     *
     * @param refundRegisterVo
     * @return
     */
    public ResCommon<Void> refundRegister(RefundRegisterVo refundRegisterVo) {
        String methodCode = "refundRegister";
        String methodName = "挂号退费";

        return doExec(methodCode, methodName, refundRegisterVo, null);
    }

    /**
     * 挂号纪录查询
     *
     * @param registerRecordsVo
     * @return
     */
    public ResCommon<List<RegisterRecordsVoResponse>> getRegisterRecords(RegisterRecordsVo registerRecordsVo) {
        String methodCode = "getRegisterRecords";
        String methodName = "挂号纪录查询";

        return doExecList(methodCode, methodName, registerRecordsVo, RegisterRecordsVoResponse.class);
    }
    
    /**
     * 挂号纪录查询（异常单）
     * 
     * @param registerExceptionRecordVo
     * @return
     */
    public ResCommon<RegisterExceptionRecordVoResponse> getRegisterExceptionRecord(RegisterExceptionRecordVo registerExceptionRecordVo) {
    	String methodCode = "getRegisterExceptionRecord";
        String methodName = "挂号纪录查询（异常单）";

        return doExec(methodCode, methodName, registerExceptionRecordVo, RegisterExceptionRecordVoResponse.class);
    }

    /**
     * 预约资料查询
     *
     * @param orderDataVo
     * @return
     */
    public ResCommon<OrderDataVoResponse> getRegisterOrderData(OrderDataVo orderDataVo) {
        String methodCode = "getRegisterOrderData";
        String methodName = "预约资料查询";

        return doExec(methodCode, methodName, orderDataVo, OrderDataVoResponse.class);
    }

    /**
     * 预约资料查询
     *
     * @param orderDataVo
     * @return
     */
    public ResCommon<List<OrderDataVoResponse>> getRegisterOrderDataList(OrderDataVo orderDataVo) {
        String methodCode = "getRegisterOrderData";
        String methodName = "预约资料查询";

        return doExecList(methodCode, methodName, orderDataVo, OrderDataVoResponse.class);
    }

    /**
     * 报到取号
     *
     * @param takeNoVo
     * @return
     */
    public ResCommon<TakeNoVoResponse> takeRegisterNo(TakeNoVo takeNoVo) {
        String methodCode = "takeRegisterNo";
        String methodName = "报到取号";

        return doExec(methodCode, methodName, takeNoVo, TakeNoVoResponse.class);
    }

    /**
     * 挂号异常确认
     *
     * @param ackRegisterExceptionVo
     * @return
     */
    public ResCommon<AckRegisterExceptionVoResponse> ackRegisterException(AckRegisterExceptionVo ackRegisterExceptionVo) {
        String methodCode = "ackRegisterException";
        String methodName = "挂号异常确认";

        return doExec(methodCode, methodName, ackRegisterExceptionVo, AckRegisterExceptionVoResponse.class);
    }
    
    /**
     * 医生停诊
     * 
     * @param stopRegisterVo
     * @return
     */
    public ResCommon<List<StopRegisterVoResponse>> stopRegister(StopRegisterVo stopRegisterVo) {
    	String methodCode = "stopRegister";
        String methodName = "医生停诊";
        
        return doExecList(methodCode, methodName, stopRegisterVo, StopRegisterVoResponse.class);
    }
    
    /**
     * 挂号医保结算
     * 
     * @param settleRegisterInsuranceVo
     * @return
     */
    public ResCommon<SettleRegisterInsuranceVoResponse> settleRegisterInsurance(SettleRegisterInsuranceVo settleRegisterInsuranceVo) {
    	String methodCode = "settleRegisterInsurance";
        String methodName = "挂号医保结算";

        return doExec(methodCode, methodName, settleRegisterInsuranceVo, SettleRegisterInsuranceVoResponse.class);
    }
    
    /**
     * 挂号医保退款
     * 
     * @param refundRegisterInsuranceVo
     * @return
     */
    public ResCommon<Void> refundRegisterInsurance(RefundRegisterInsuranceVo refundRegisterInsuranceVo) {
    	String methodCode = "refundRegisterInsurance";
    	String methodName = "挂号医保退款";
    	
    	return doExec(methodCode, methodName, refundRegisterInsuranceVo, null);
    }

    /**
     * 自动取号
     *
     * @param takeNoVo
     * @return
     */
    public ResCommon<List<AutoTakeNoVoResponse>> autoTakeRegisterNo(BaseVo takeNoVo) {
        String methodCode = "getAutoTakeNo";
        String methodName = "自动取号";

        return doExecList(methodCode, methodName, takeNoVo, AutoTakeNoVoResponse.class);
    }
}
